package com.demo.bannerview;

import com.module.commonui.R;

public class ViewBindingSampleAdapter extends BaseBannerAdapter<Integer> {

  private final int mRoundCorner;

  public ViewBindingSampleAdapter(int roundCorner) {
    mRoundCorner = roundCorner;
  }

  @Override
  protected void bindData(BaseViewHolder holder, Integer data, int position,
                          int pageSize) {
    //示例使用ViewBinding
    //ItemSlideModeBinding viewBinding = ItemSlideModeBinding.bind(holder.itemView);
    CornerImageView imageView = holder.itemView.findViewById(R.id.corner_image);
    imageView.setRoundCorner(mRoundCorner);
    imageView.setImageResource(data);
  }

  @Override
  public int getLayoutId(int viewType) {
    return R.layout.item_slide_mode;
  }
}

